public class MethodTest2 {
    public MethodTest2() {
    }

    public static void main(String[] args) {
        double price = Calculate(11, 500.0, "经济舱");
        System.out.println("当前优惠完的价格是：" + price + "元");
    }

    public static double Calculate(int month, double price, String type) {
        if (month >= 5 && month <= 10) {
            switch (type) {
                case "头等舱":
                    price *= 0.9;
                    break;
                case "经济舱":
                    price *= 0.85;
            }
        } else {
            switch (type) {
                case "头等舱":
                    price *= 0.7;
                    break;
                case "经济舱":
                    price *= 0.65;
            }
        }

        return price;
    }
}
